#include <Glacier2/Glacier2.h>
#include <IceSSL/Plugin.h>

using namespace std;

class SSLPermissionsVerifier : public Glacier2::SSLPermissionsVerifier
{
public:
  virtual bool
  authorize(const Glacier2::SSLInfo& info,
	    string&, const Ice::Current&) const
  {

    IceSSL::CertificatePtr c = IceSSL::Certificate::decode(info.certs[0]);
    string dn = c->getIssuerDN();
    
    if(dn.find("GridCA-blanko") != string::npos){
      cout << endl << endl << "Devolviendo TRUE" << endl << endl;
      return true;
    }

    cout << endl << endl << "Devolviendo FALSE" << endl << endl;
    return false;
  }
};
